home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume13 / xfig2.9 / patch10.03 < prev    next >
Encoding:
Text File  |  1991-07-05  |  54.2 KB  |  1,812 lines

  1. Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
  2. From: envbvs@bea.lbl.gov (Brian V. Smith)
  3. Newsgroups: comp.sources.x
  4. Subject: v13i070: xfig2, Patch10, Part03/04
  5. Message-ID: <16333@exodus.Eng.Sun.COM>
  6. Date: 6 Jul 91 06:59:21 GMT
  7. References: <csx-13i068-xfig2.9@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 1800
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
  13. Posting-number: Volume 13, Issue 70
  14. Archive-name: xfig2.9/patch10.03
  15. Patch-To: xfig2.9: Volume XXX, Issue XXX
  16. Patch-To: xfig2.9: Volume 10, Issue 26-31
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 3 (of 4)."
  25. # Contents:  patch10.1
  26. # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:03 1991
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch10.1' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patch10.1'\"
  30. else
  31. echo shar: Extracting \"'patch10.1'\" \(51690 characters\)
  32. sed "s/^X//" >'patch10.1' <<'END_OF_FILE'
  33. X*** @xfig.pl9/CHANGES    Fri Sep 21 10:16:36 1990
  34. X--- ./CHANGES    Fri Jun 14 12:47:59 1991
  35. X***************
  36. X*** 1,5 ****
  37. X--- 1,68 ----
  38. X  Version 2.0 
  39. X  
  40. X+ Patchlevel 10
  41. X+ Changes from patchlevel 9:
  42. X+ 
  43. X+ o zooming and panning is now possible for all objects except texts.
  44. X+     Use new buttons, arrow keys for panning. See the man page.
  45. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  46. X+ o selecting one of several overlapping objects is implemented for
  47. X+     most functions.
  48. X+     Hold down Shift key while clicking on object to cycle through
  49. X+     candidate objects, release shift key for selection. See man page.
  50. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  51. X+ o dash length and dot gap width can be modified using the Change menu
  52. X+     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  53. X+ o dash length scaled to line width and zoom factor
  54. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  55. X+ o multiple Grid Sizes
  56. X+     Two grids are available in the -metric mode
  57. X+     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  58. X+ o open polygons and splines can be filled
  59. X+     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  60. X+ o new resource 'Startfontsize' and command line option -startfontsize
  61. X+     From Georg Sigl (ges@regent.e-technik.tu-muenchen.de)
  62. X+ o point markers displayed with text objects
  63. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  64. X+ o grid and ruler bitmaps are created dynamically
  65. X+     This was neccessary for the zoom and pan commands
  66. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  67. X+ o changing text by clicking on it has to be finished with the left
  68. X+     button. Finishing with the middle button is no longer possible
  69. X+     (this is rather a workaround for the bug that gave interesting 
  70. X+     effects)
  71. X+     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  72. X+ o if a point is to be deleted from a line, at least 2 points must remain
  73. X+     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  74. X+ o fixed bug where finishing text with middle button, saving figure
  75. X+     and trying to quit made xfig claim the figure hadn't been saved
  76. X+ o fixed bug where line of zero length with an arrow head would cause f2ps 
  77. X+     to divide by zero
  78. X+ o there is a bug in OpenWindows which causes xfig to crash when trying to 
  79. X+     create the pixmaps from one-plane bitmaps for the button icons.  According
  80. X+     to the Intrinsics manual, the XtNbitmap resource in a widget will auto-
  81. X+     matically be converted to the proper screen depth, but OpenWindows seems
  82. X+     not to do this.  Add the define "-DOPENWIN" to the "DEFINES" line
  83. X+     in the Imakefile if you are running OpenWindows.
  84. X+ o depth of objects is now honored - set object depth with popup change window
  85. X+     From Mike Lutz <mjl@cs.rit.edu>
  86. X+ o bug fixed where "create object -> read file -> undo" would delete objects
  87. X+     Tom Tkacik (tkacik@hobbes.cs.gmr.com)
  88. X+ o creation of text is now undoable
  89. X+ o text inside compound is erased properly when compound is moved/deleted etc
  90. X+ o f2ps now uses the -s (font size) option when objects are defined
  91. X+     with default font size (-1)
  92. X+     From Ian Dall <idall@augean.ua.oz.au>
  93. X+ o font spacing button value no longer crashes xfig on MIPS type machine
  94. X+ o having spline where two or more points are coincident no longer
  95. X+     gives DOMAIN error or crashes xfig
  96. X+     From Mike Lawley <lawley@muse.cs.mu.oz.au>
  97. X+ o attempting to draw arc with two or more coincident points no longer 
  98. X+     crashes xfig
  99. X+ o definition of errno, sys_nerr and sys_errlist moved to fig.h
  100. X+     From Casey Leedem <casey@gauss.llnl.gov>
  101. X+ o removed startup message printing to stdout
  102. X+ 
  103. X  Patchlevel 9
  104. X  Changes from patchlevel 8:
  105. X  
  106. X***************
  107. X*** 41,47 ****
  108. X      longer supported :-(
  109. X  o Moved initializing of Fig icon in main() to work with mwm
  110. X      From David Elliot <dce@smsc.sony.com>
  111. X! o f2p and f2ps now return meaningfull error codes: 0 for OK, 1 for error
  112. X  o Errors in reading figure file should report correct line numbers now
  113. X  o Handles "default" font for TransFig correctly
  114. X  o Text input is now correctly terminated whenever a menu item is chosen,
  115. X--- 104,110 ----
  116. X      longer supported :-(
  117. X  o Moved initializing of Fig icon in main() to work with mwm
  118. X      From David Elliot <dce@smsc.sony.com>
  119. X! o f2p and f2ps now return meaningful error codes: 0 for OK, 1 for error
  120. X  o Errors in reading figure file should report correct line numbers now
  121. X  o Handles "default" font for TransFig correctly
  122. X  o Text input is now correctly terminated whenever a menu item is chosen,
  123. X*** @xfig.pl9/Imakefile    Fri Sep 21 09:54:58 1990
  124. X--- ./Imakefile    Tue Jun 11 17:17:59 1991
  125. X***************
  126. X*** 14,23 ****
  127. X          ellipse.c file.c flip.c font.c free.c geom.c\
  128. X          global.c glue.c graphics.c grid.c intspline.c\
  129. X          latex_line.c line.c list.c main.c move.c movept.c\
  130. X!         msgsw.c panel.c popup.c print.c printfonts.c psbits.c\
  131. X!         psfonts.c puterr.c read.c read1_3.c redisplay.c\
  132. X!         remove.c rotate.c ruler.c save.c scale.c search.c\
  133. X!         spline.c text.c trans.c turn.c undo.c util.c xtra.c
  134. X  
  135. X  XFIGOBJ =    addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
  136. X          blink.o bound.o box.o break.o canvas.o change.o\
  137. X--- 14,24 ----
  138. X          ellipse.c file.c flip.c font.c free.c geom.c\
  139. X          global.c glue.c graphics.c grid.c intspline.c\
  140. X          latex_line.c line.c list.c main.c move.c movept.c\
  141. X!         msgsw.c pan.c panel.c popup.c print.c printfonts.c\
  142. X!         psbits.c psfonts.c puterr.c read.c read1_3.c\
  143. X!         redisplay.c remove.c rotate.c ruler.c save.c scale.c\
  144. X!         search.c spline.c text.c trans.c turn.c undo.c util.c\
  145. X!         xtra.c zoom.c
  146. X  
  147. X  XFIGOBJ =    addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
  148. X          blink.o bound.o box.o break.o canvas.o change.o\
  149. X***************
  150. X*** 25,35 ****
  151. X          cursor.o curve.o deletept.o dir.o drag.o draw.o\
  152. X          ellipse.o file.o flip.o font.o free.o geom.o global.o\
  153. X          glue.o graphics.o grid.o intspline.o latex_line.o\
  154. X!         line.o list.o main.o move.o movept.o msgsw.o panel.o\
  155. X!         popup.o print.o printfonts.o psbits.o psfonts.o\
  156. X          puterr.o read.o read1_3.o redisplay.o remove.o\
  157. X          rotate.o ruler.o save.o scale.o search.o spline.o\
  158. X!         text.o trans.o turn.o undo.o util.o xtra.o
  159. X  
  160. X  F2PSRC =        arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
  161. X  F2POBJ =        arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
  162. X--- 26,36 ----
  163. X          cursor.o curve.o deletept.o dir.o drag.o draw.o\
  164. X          ellipse.o file.o flip.o font.o free.o geom.o global.o\
  165. X          glue.o graphics.o grid.o intspline.o latex_line.o\
  166. X!         line.o list.o main.o move.o movept.o msgsw.o pan.o\
  167. X!         panel.o popup.o print.o printfonts.o psbits.o psfonts.o\
  168. X          puterr.o read.o read1_3.o redisplay.o remove.o\
  169. X          rotate.o ruler.o save.o scale.o search.o spline.o\
  170. X!         text.o trans.o turn.o undo.o util.o xtra.o zoom.o
  171. X  
  172. X  F2PSRC =        arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
  173. X  F2POBJ =        arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
  174. X*** @xfig.pl9/Makefile    Thu Jul  5 14:42:05 1990
  175. X--- ./Makefile    Fri Jun 14 10:33:36 1991
  176. X***************
  177. X*** 244,253 ****
  178. X          ellipse.c file.c flip.c font.c free.c geom.c\
  179. X          global.c glue.c graphics.c grid.c intspline.c\
  180. X          latex_line.c line.c list.c main.c move.c movept.c\
  181. X!         msgsw.c panel.c popup.c print.c printfonts.c psbits.c\
  182. X!         psfonts.c puterr.c read.c read1_3.c redisplay.c\
  183. X!         remove.c rotate.c ruler.c save.c scale.c search.c\
  184. X!         spline.c text.c trans.c turn.c undo.c util.c xtra.c
  185. X  
  186. X  XFIGOBJ =    addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
  187. X          blink.o bound.o box.o break.o canvas.o change.o\
  188. X--- 244,254 ----
  189. X          ellipse.c file.c flip.c font.c free.c geom.c\
  190. X          global.c glue.c graphics.c grid.c intspline.c\
  191. X          latex_line.c line.c list.c main.c move.c movept.c\
  192. X!         msgsw.c pan.c panel.c popup.c print.c printfonts.c\
  193. X!         psbits.c psfonts.c puterr.c read.c read1_3.c\
  194. X!         redisplay.c remove.c rotate.c ruler.c save.c scale.c\
  195. X!         search.c spline.c text.c trans.c turn.c undo.c util.c\
  196. X!         xtra.c zoom.c
  197. X  
  198. X  XFIGOBJ =    addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
  199. X          blink.o bound.o box.o break.o canvas.o change.o\
  200. X***************
  201. X*** 255,265 ****
  202. X          cursor.o curve.o deletept.o dir.o drag.o draw.o\
  203. X          ellipse.o file.o flip.o font.o free.o geom.o global.o\
  204. X          glue.o graphics.o grid.o intspline.o latex_line.o\
  205. X!         line.o list.o main.o move.o movept.o msgsw.o panel.o\
  206. X!         popup.o print.o printfonts.o psbits.o psfonts.o\
  207. X          puterr.o read.o read1_3.o redisplay.o remove.o\
  208. X          rotate.o ruler.o save.o scale.o search.o spline.o\
  209. X!         text.o trans.o turn.o undo.o util.o xtra.o
  210. X  
  211. X  F2PSRC =        arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
  212. X  F2POBJ =        arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
  213. X--- 256,266 ----
  214. X          cursor.o curve.o deletept.o dir.o drag.o draw.o\
  215. X          ellipse.o file.o flip.o font.o free.o geom.o global.o\
  216. X          glue.o graphics.o grid.o intspline.o latex_line.o\
  217. X!         line.o list.o main.o move.o movept.o msgsw.o pan.o\
  218. X!         panel.o popup.o print.o printfonts.o psbits.o psfonts.o\
  219. X          puterr.o read.o read1_3.o redisplay.o remove.o\
  220. X          rotate.o ruler.o save.o scale.o search.o spline.o\
  221. X!         text.o trans.o turn.o undo.o util.o xtra.o zoom.o
  222. X  
  223. X  F2PSRC =        arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
  224. X  F2POBJ =        arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
  225. X***************
  226. X*** 389,391 ****
  227. X--- 390,393 ----
  228. X  ###########################################################################
  229. X  # dependencies generated by makedepend
  230. X  
  231. X+ # DO NOT DELETE THIS LINE -- make depend depends on it.
  232. X*** @xfig.pl9/addpt.c    Mon Apr 30 12:12:44 1990
  233. X--- ./addpt.c    Fri Jun 14 09:01:14 1991
  234. X***************
  235. X*** 15,22 ****
  236. X  #include "object.h"
  237. X  #include "paintop.h"
  238. X  
  239. X- #define            TOLERANCE    3
  240. X- 
  241. X  extern F_line        *line_search();
  242. X  extern F_spline        *spline_search();
  243. X  extern            (*canvas_kbd_proc)();
  244. X--- 15,20 ----
  245. X***************
  246. X*** 38,43 ****
  247. X--- 36,44 ----
  248. X  extern F_point        *added_point;
  249. X  extern F_point        *left_point, *right_point;
  250. X  
  251. X+ extern int init_object_search();
  252. X+ extern int object_search();
  253. X+ 
  254. X  extern int        init_point_adding();
  255. X  extern int        move_addedpoint();
  256. X  extern int        fix_linepoint_adding();
  257. X***************
  258. X*** 52,81 ****
  259. X  {
  260. X      canvas_kbd_proc = null_proc;
  261. X      canvas_locmove_proc = null_proc;
  262. X!     canvas_leftbut_proc = init_point_adding;
  263. X      canvas_middlebut_proc = null_proc;
  264. X      canvas_rightbut_proc = set_popupmenu;
  265. X      set_cursor(&pick9_cursor);
  266. X      }
  267. X  
  268. X! init_point_adding(x, y)
  269. X  int    x, y;
  270. X  {
  271. X-     int    px, py;
  272. X  
  273. X!     if ((cur_line = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  274. X!         if (cur_line->type == T_BOX || cur_line->type == T_ARC_BOX) {
  275. X          put_msg("Adding points to a box is not allowed");
  276. X          return;
  277. X          }
  278. X          init_linepointadding(px, py);
  279. X!         }
  280. X!     else if ((cur_spline = spline_search(x,y,TOLERANCE,&px,&py)) != NULL){
  281. X          init_splinepointadding(px, py);
  282. X!         }
  283. X!     else {
  284. X!         return;
  285. X!         }
  286. X      canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  287. X      erase_pointmarker();
  288. X      }
  289. X--- 53,88 ----
  290. X  {
  291. X      canvas_kbd_proc = null_proc;
  292. X      canvas_locmove_proc = null_proc;
  293. X!     /* store handler address with object search function */
  294. X!     init_object_search(init_point_adding);
  295. X!     canvas_leftbut_proc = object_search;
  296. X      canvas_middlebut_proc = null_proc;
  297. X      canvas_rightbut_proc = set_popupmenu;
  298. X      set_cursor(&pick9_cursor);
  299. X      }
  300. X  
  301. X! init_point_adding(p,type,x, y,px,py)
  302. X! char *p;
  303. X! int type;
  304. X  int    x, y;
  305. X+ int    px, py;
  306. X  {
  307. X  
  308. X!     switch(type)
  309. X!     { case O_POLYLINE:
  310. X!         cur_line=(F_line *) p;
  311. X!         if (cur_line->type == T_BOX || cur_line->type ==T_ARC_BOX) {
  312. X          put_msg("Adding points to a box is not allowed");
  313. X          return;
  314. X          }
  315. X          init_linepointadding(px, py);
  316. X!         break;
  317. X!       case O_SPLINE:
  318. X!         cur_spline=(F_spline *) p; 
  319. X          init_splinepointadding(px, py);
  320. X!         break;
  321. X!       default: return;
  322. X!     }
  323. X      canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  324. X      erase_pointmarker();
  325. X      }
  326. X***************
  327. X*** 183,198 ****
  328. X      find_endpoints(cur_line->points,px,py,&left_point,&right_point);
  329. X      set_temp_cursor(&null_cursor);
  330. X      win_setmouseposition(canvas_win, px, py);
  331. X      cur_x = fix_x = px; cur_y = fix_y = py;
  332. X      if (left_point == NULL && cur_line->type == T_POLYGON) {
  333. X          left_point = right_point;
  334. X          right_point = right_point->next;
  335. X          }
  336. X      if (left_point != NULL && right_point != NULL)
  337. X          pw_vector(canvas_win, left_point->x, left_point->y,
  338. X!         right_point->x, right_point->y, INV_PAINT, 
  339. X          cur_line->thickness, cur_line->style, cur_line->style_val);
  340. X!     draw_addedlink(INV_PAINT);
  341. X      if (latexline_mode || latexarrow_mode) {
  342. X          canvas_locmove_proc = latex_elasticline;
  343. X          canvas_middlebut_proc = mm_fix_linepoint_adding;
  344. X--- 190,209 ----
  345. X      find_endpoints(cur_line->points,px,py,&left_point,&right_point);
  346. X      set_temp_cursor(&null_cursor);
  347. X      win_setmouseposition(canvas_win, px, py);
  348. X+ 
  349. X+     /* set cur_x etc at new point coords */
  350. X      cur_x = fix_x = px; cur_y = fix_y = py;
  351. X      if (left_point == NULL && cur_line->type == T_POLYGON) {
  352. X          left_point = right_point;
  353. X          right_point = right_point->next;
  354. X          }
  355. X+     /* erase line segment where new point is */
  356. X      if (left_point != NULL && right_point != NULL)
  357. X          pw_vector(canvas_win, left_point->x, left_point->y,
  358. X!         right_point->x, right_point->y, ERASE, 
  359. X          cur_line->thickness, cur_line->style, cur_line->style_val);
  360. X!     /* draw in rubber-band line */
  361. X!     draw_addedlink(PAINT);
  362. X      if (latexline_mode || latexarrow_mode) {
  363. X          canvas_locmove_proc = latex_elasticline;
  364. X          canvas_middlebut_proc = mm_fix_linepoint_adding;
  365. X***************
  366. X*** 305,310 ****
  367. X--- 316,324 ----
  368. X      *fp = a;
  369. X      *sp = b;
  370. X      }
  371. X+ 
  372. X+ /* draw rubber-band lines between left-point and cur_x/y and between
  373. X+    right point and cur_x/y */
  374. X  
  375. X  draw_addedlink(op)
  376. X  int    op;
  377. X*** @xfig.pl9/arc.c    Tue May  1 16:33:45 1990
  378. X--- ./arc.c    Mon Jun  3 11:12:55 1991
  379. X***************
  380. X*** 110,117 ****
  381. X  
  382. X      x = point[0].x;  y = point[0].y;
  383. X      for (i = 1; i < num_point; i++) {
  384. X!         pw_vector(canvas_win, x, y, point[i].x, point[i].y, INV_PAINT,
  385. X!             1, SOLID_LINE, 0.0);
  386. X          x = point[i].x;  y = point[i].y;
  387. X          }
  388. X      if (num_point < 3) {
  389. X--- 110,117 ----
  390. X  
  391. X      x = point[0].x;  y = point[0].y;
  392. X      for (i = 1; i < num_point; i++) {
  393. X!         pw_vector(canvas_win, x, y, point[i].x, point[i].y, 
  394. X!             INV_PAINT, 1, RUBBER_LINE, 0.0);
  395. X          x = point[i].x;  y = point[i].y;
  396. X          }
  397. X      if (num_point < 3) {
  398. X***************
  399. X*** 132,138 ****
  400. X      arc->type = T_3_POINTS_ARC;
  401. X      arc->style = line_style;
  402. X      arc->thickness = line_thickness;
  403. X!     arc->style_val = cur_styleval;
  404. X      arc->pen = 0;
  405. X      arc->area_fill = fill_mode? cur_areafill : 0;
  406. X      arc->color = cur_color;
  407. X--- 132,139 ----
  408. X      arc->type = T_3_POINTS_ARC;
  409. X      arc->style = line_style;
  410. X      arc->thickness = line_thickness;
  411. X!     /* scale dash length according to linethickness */
  412. X!     arc->style_val = cur_styleval*(line_thickness+1)/2;
  413. X      arc->pen = 0;
  414. X      arc->area_fill = fill_mode? cur_areafill : 0;
  415. X      arc->color = cur_color;
  416. X*** @xfig.pl9/arcbox.c    Mon Apr 30 12:12:48 1990
  417. X--- ./arcbox.c    Mon Jun  3 11:12:56 1991
  418. X***************
  419. X*** 89,95 ****
  420. X      box->depth = 0;
  421. X      box->pen = 0;
  422. X      box->area_fill = fill_mode? cur_areafill : 0;
  423. X!     box->style_val = cur_styleval;
  424. X      box->radius = cur_radius;    /* corner radius */
  425. X      box->for_arrow = NULL;
  426. X      box->back_arrow = NULL;
  427. X--- 89,96 ----
  428. X      box->depth = 0;
  429. X      box->pen = 0;
  430. X      box->area_fill = fill_mode? cur_areafill : 0;
  431. X!     /* multiply  dash length by line thickness */
  432. X!     box->style_val = cur_styleval*(line_thickness+1)/2;
  433. X      box->radius = cur_radius;    /* corner radius */
  434. X      box->for_arrow = NULL;
  435. X      box->back_arrow = NULL;
  436. X*** @xfig.pl9/autoarrow.c    Tue May  1 16:23:11 1990
  437. X--- ./autoarrow.c    Mon Jun  3 11:12:59 1991
  438. X***************
  439. X*** 13,20 ****
  440. X  #include "object.h"
  441. X  #include "paintop.h"
  442. X  
  443. X- #define            TOLERANCE    7
  444. X- 
  445. X  extern            (*canvas_kbd_proc)();
  446. X  extern            (*canvas_locmove_proc)();
  447. X  extern            (*canvas_leftbut_proc)();
  448. X--- 13,18 ----
  449. X***************
  450. X*** 32,39 ****
  451. X  
  452. X  F_point            *selected_point, *left_point;
  453. X  int            arcpoint_num;
  454. X! extern int        add_arrow_head();
  455. X! extern int        delete_arrow_head();
  456. X  
  457. X  #define            round(x)    ((int) (x + .5))
  458. X  
  459. X--- 30,39 ----
  460. X  
  461. X  F_point            *selected_point, *left_point;
  462. X  int            arcpoint_num;
  463. X! int            add_arrow_head();
  464. X! int            delete_arrow_head();
  465. X! extern    int    point_search();
  466. X! extern    int    point_search_middle();
  467. X  
  468. X  #define            round(x)    ((int) (x + .5))
  469. X  
  470. X***************
  471. X*** 41,101 ****
  472. X  {
  473. X      canvas_kbd_proc = null_proc;
  474. X      canvas_locmove_proc = null_proc;
  475. X!     canvas_leftbut_proc = add_arrow_head;
  476. X!     canvas_middlebut_proc = delete_arrow_head;
  477. X      canvas_rightbut_proc = set_popupmenu;
  478. X      set_cursor(&pick9_cursor);
  479. X      }
  480. X  
  481. X! add_arrow_head(x, y)
  482. X! int    x, y;
  483. X  {
  484. X      F_line        *line;
  485. X      F_spline    *spline;
  486. X      F_arc        *arc;
  487. X  
  488. X!     if ((line = line_point_search(x, y, TOLERANCE,
  489. X!         &left_point, &selected_point)) != NULL) {
  490. X!         add_linearrow(line);
  491. X!         }
  492. X!     else if ((spline = spline_point_search(x, y, 
  493. X!         TOLERANCE, &left_point, &selected_point)) != NULL){
  494. X!         add_splinearrow(spline);
  495. X!         }
  496. X!     else if ((arc = arc_point_search(x, y, TOLERANCE, 
  497. X!         &arcpoint_num)) != NULL) {
  498. X!         add_arcarrow(arc);
  499. X!         }
  500. X!     else
  501. X          return;
  502. X  
  503. X      set_modifiedflag();
  504. X      }
  505. X  
  506. X! delete_arrow_head(x, y)
  507. X! int    x, y;
  508. X  {
  509. X      F_line        *line;
  510. X      F_spline    *spline;
  511. X      F_arc        *arc;
  512. X  
  513. X!     if ((line = line_point_search(x, y, TOLERANCE,
  514. X!         &left_point, &selected_point)) != NULL) {
  515. X!         delete_linearrow(line);
  516. X!         }
  517. X!     else if ((spline = spline_point_search(x, y, 
  518. X!         TOLERANCE, &left_point, &selected_point)) != NULL){
  519. X!         delete_splinearrow(spline);
  520. X!         }
  521. X!     else if ((arc = arc_point_search(x, y, TOLERANCE, 
  522. X!         &arcpoint_num)) != NULL) {
  523. X!         delete_arcarrow(arc);
  524. X!         }
  525. X!     else
  526. X          return;
  527. X! 
  528. X      set_modifiedflag();
  529. X!     }
  530. X  
  531. X  add_linearrow(line)
  532. X  F_line    *line;
  533. X--- 41,118 ----
  534. X  {
  535. X      canvas_kbd_proc = null_proc;
  536. X      canvas_locmove_proc = null_proc;
  537. X!     /* store handler address with point_search */
  538. X!     init_point_search(add_arrow_head);
  539. X!     init_point_search_middle(delete_arrow_head);
  540. X!     canvas_leftbut_proc = point_search;
  541. X!     canvas_middlebut_proc = point_search_middle;
  542. X      canvas_rightbut_proc = set_popupmenu;
  543. X      set_cursor(&pick9_cursor);
  544. X      }
  545. X  
  546. X! add_arrow_head(obj, type, x, y, p, q)
  547. X! char *obj;
  548. X! int type,x,y;
  549. X! F_point *p,*q;
  550. X  {
  551. X      F_line        *line;
  552. X      F_spline    *spline;
  553. X      F_arc        *arc;
  554. X  
  555. X!         left_point=p;
  556. X!         selected_point=q;
  557. X!     switch(type)
  558. X!     { case O_POLYLINE:
  559. X!         line=(F_line *) obj;
  560. X!         add_linearrow(line);
  561. X!         break;
  562. X!       case O_SPLINE:
  563. X!         spline=(F_spline *) obj;
  564. X!         add_splinearrow(spline);
  565. X!         break;
  566. X!       case O_ARC:
  567. X!         /* arcpoint_num is stored in x coordinate - dirty trick */
  568. X!         arcpoint_num=(int) p;
  569. X!         arc=(F_arc *) obj;
  570. X!         add_arcarrow(arc);
  571. X!         break;
  572. X!       default:
  573. X          return;
  574. X+         }
  575. X  
  576. X      set_modifiedflag();
  577. X      }
  578. X  
  579. X! delete_arrow_head(obj, type, x, y, p, q)
  580. X! char *obj;
  581. X! int type,x,y;
  582. X! F_point *p,*q;
  583. X  {
  584. X      F_line        *line;
  585. X      F_spline    *spline;
  586. X      F_arc        *arc;
  587. X  
  588. X!         left_point=p;
  589. X!         selected_point=q;
  590. X!     switch(type)
  591. X!     { case O_POLYLINE:
  592. X!         line=(F_line *) obj;
  593. X!         delete_linearrow(line);
  594. X!         break;
  595. X!       case O_SPLINE:
  596. X!         spline=(F_spline *) obj;
  597. X!         delete_splinearrow(spline);
  598. X!         break;
  599. X!       case O_ARC:
  600. X!         arcpoint_num=(int) p;
  601. X!         arc=(F_arc *) obj;
  602. X!         delete_arcarrow(arc);
  603. X!         break;
  604. X!       default:
  605. X          return;
  606. X!         }
  607. X      set_modifiedflag();
  608. X!       }
  609. X  
  610. X  add_linearrow(line)
  611. X  F_line    *line;
  612. X*** @xfig.pl9/bitmap.c    Thu Jul  5 14:48:24 1990
  613. X--- ./bitmap.c    Mon Jun  3 13:25:15 1991
  614. X***************
  615. X*** 15,27 ****
  616. X  extern int        CANVAS_WIDTH, CANVAS_HEIGHT;
  617. X  extern F_compound    objects;
  618. X  
  619. X- extern int        errno;
  620. X  extern int        pointmarker_shown;
  621. X  extern int        compoundbox_shown;
  622. X  extern appresStruct    appres;
  623. X- 
  624. X- extern char        *sys_errlist[];
  625. X- extern int        sys_nerr, errno;
  626. X  
  627. X  write_bitmap(file_name)
  628. X  char    *file_name;
  629. X--- 15,23 ----
  630. X*** @xfig.pl9/box.c    Tue May  1 16:40:15 1990
  631. X--- ./box.c    Mon Jun  3 11:13:02 1991
  632. X***************
  633. X*** 63,72 ****
  634. X  draw_rectbox(x1, y1, x2, y2, op)
  635. X  int    x1, y1, x2, y2, op;
  636. X  {
  637. X!     pw_vector(canvas_win, x1, y1, x1, y2, op, 1, SOLID_LINE, 0.0);
  638. X!     pw_vector(canvas_win, x1, y2, x2, y2, op, 1, SOLID_LINE, 0.0);
  639. X!     pw_vector(canvas_win, x2, y2, x2, y1, op, 1, SOLID_LINE, 0.0);
  640. X!     pw_vector(canvas_win, x2, y1, x1, y1, op, 1, SOLID_LINE, 0.0);
  641. X      }
  642. X  
  643. X  elastic_box(x, y)
  644. X--- 63,73 ----
  645. X  draw_rectbox(x1, y1, x2, y2, op)
  646. X  int    x1, y1, x2, y2, op;
  647. X  {
  648. X!     /* linewidth = RUBBER_LINE means don't scale */
  649. X!     pw_vector(canvas_win, x1, y1, x1, y2, op, 1, RUBBER_LINE, 0.0);
  650. X!     pw_vector(canvas_win, x1, y2, x2, y2, op, 1, RUBBER_LINE, 0.0);
  651. X!     pw_vector(canvas_win, x2, y2, x2, y1, op, 1, RUBBER_LINE, 0.0);
  652. X!     pw_vector(canvas_win, x2, y1, x1, y1, op, 1, RUBBER_LINE, 0.0);
  653. X      }
  654. X  
  655. X  elastic_box(x, y)
  656. X***************
  657. X*** 109,115 ****
  658. X      box->depth = NULL;
  659. X      box->pen = 0;
  660. X      box->area_fill = fill_mode? cur_areafill : 0;
  661. X!     box->style_val = cur_styleval;
  662. X      box->radius = 0;
  663. X      box->for_arrow = NULL;
  664. X      box->back_arrow = NULL;
  665. X--- 110,117 ----
  666. X      box->depth = NULL;
  667. X      box->pen = 0;
  668. X      box->area_fill = fill_mode? cur_areafill : 0;
  669. X!     /* scale dash length by line thickness */
  670. X!     box->style_val = cur_styleval*(line_thickness+1)/2;
  671. X      box->radius = 0;
  672. X      box->for_arrow = NULL;
  673. X      box->back_arrow = NULL;
  674. X*** @xfig.pl9/canvas.c    Tue May  1 16:33:46 1990
  675. X--- ./canvas.c    Mon Jun  3 13:25:15 1991
  676. X***************
  677. X*** 11,23 ****
  678. X  #include "resources.h"
  679. X  #include "const.h"
  680. X  #include "paintop.h"
  681. X  
  682. X  /***************** import global variables and routines *******************/
  683. X  
  684. X  extern int        cur_command;
  685. X- extern int        errno;
  686. X  extern int        action_on;     /* tracker.c */
  687. X  extern int        magnet_mode;
  688. X  
  689. X  extern int        CANVAS_WIDTH, CANVAS_HEIGHT;
  690. X  extern            null_proc();
  691. X--- 11,26 ----
  692. X  #include "resources.h"
  693. X  #include "const.h"
  694. X  #include "paintop.h"
  695. X+ #include "zoom.h"
  696. X+ #include <X11/keysym.h>
  697. X+ #include "X11/X.h"      /* for ShiftMask */
  698. X  
  699. X  /***************** import global variables and routines *******************/
  700. X  
  701. X  extern int        cur_command;
  702. X  extern int        action_on;     /* tracker.c */
  703. X  extern int        magnet_mode;
  704. X+ extern int        grid2_mode;
  705. X  
  706. X  extern int        CANVAS_WIDTH, CANVAS_HEIGHT;
  707. X  extern            null_proc();
  708. X***************
  709. X*** 28,34 ****
  710. X--- 31,39 ----
  711. X  extern            (*canvas_rightbut_proc)();
  712. X  extern            null_proc();
  713. X  extern            set_popupmenu();
  714. X+ extern            appresStruct    appres;
  715. X  
  716. X+ extern int        gc_thickness[NUMOPS];     /* for zoom */
  717. X  
  718. X  /*********************** local variables and routines ************************/
  719. X  
  720. X***************
  721. X*** 174,185 ****
  722. X      XButtonPressedEvent    *be = (XButtonPressedEvent *)event;
  723. X      XKeyPressedEvent    *ke = (XKeyPressedEvent *)event;
  724. X  
  725. X!     x = event->x;
  726. X!     y = event->y;
  727. X      if (magnet_mode)
  728. X      {
  729. X!         x = ((t = x % 5) < 3) ? x - t - 1 : x + 5 - t - 1;
  730. X!         y = ((t = y % 5) < 3) ? y - t - 1 : y + 5 - t - 1;
  731. X      }
  732. X      switch (event->type)
  733. X      {
  734. X--- 179,208 ----
  735. X      XButtonPressedEvent    *be = (XButtonPressedEvent *)event;
  736. X      XKeyPressedEvent    *ke = (XKeyPressedEvent *)event;
  737. X  
  738. X!         /* translate coordinates on zoomed canvas to object 
  739. X!        coordinates */
  740. X!     x = BACKX(event->x);
  741. X!     y = BACKY(event->y);
  742. X      if (magnet_mode)
  743. X      {
  744. X!         if (appres.INCHES)   /* inch system */
  745. X!         {
  746. X!             x = ((t = x % 5) < 2/*3*/) ? x - t - 1 : x + 5 - t - 1;
  747. X!             y = ((t = y % 5) < 2) ? y - t - 1 : y + 5 - t - 1;
  748. X!         }
  749. X!         else  /* metric system - allow for 2 grid sizes */
  750. X!         {
  751. X!             if (grid2_mode) 
  752. X!             {
  753. X!                 x = ((t = x % 15) < 7/*8*/) ? x - t - 1 : x + 15 - t - 1;
  754. X!                 y = ((t = y % 15) < 7) ? y - t - 1 : y + 15 - t - 1;
  755. X!             }
  756. X!             else
  757. X!             {
  758. X!                 x = ((t = x % 3) < 1/*2*/) ? x - t - 1 : x + 3 - t - 1;
  759. X!                 y = ((t = y % 3) < 1) ? y - t - 1 : y + 3 - t - 1;
  760. X!             }
  761. X!         }
  762. X      }
  763. X      switch (event->type)
  764. X      {
  765. X***************
  766. X*** 196,217 ****
  767. X                        &cx, &cy,
  768. X                        &mask);
  769. X              if(cx == sx && cy == sy) break;
  770. X!             x = sx = cx;
  771. X!             y = sy = cy;
  772. X          }
  773. X          set_rulermark(x, y);
  774. X          (*canvas_locmove_proc)(x, y);
  775. X          break;
  776. X      case ButtonPress:
  777. X          if (be->button & Button1)
  778. X!             (*canvas_leftbut_proc)(x, y);
  779. X          else if (be->button & Button2)
  780. X!             (*canvas_middlebut_proc)(x, y);
  781. X          break;
  782. X      case KeyPress:
  783. X!         if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
  784. X!             (*canvas_kbd_proc)((unsigned char)buf[0]);
  785. X!         break;
  786. X      }
  787. X  }
  788. X  
  789. X--- 219,265 ----
  790. X                        &cx, &cy,
  791. X                        &mask);
  792. X              if(cx == sx && cy == sy) break;
  793. X!             x = sx = BACKX(cx);  /* these are zoomed */
  794. X!             y = sy = BACKY(cy);  /* coordinates!     */
  795. X          }
  796. X          set_rulermark(x, y);
  797. X          (*canvas_locmove_proc)(x, y);
  798. X          break;
  799. X      case ButtonPress:
  800. X+         /* new: propagate state of shift key to clients */
  801. X          if (be->button & Button1)
  802. X!             (*canvas_leftbut_proc)(x, y, be->state&ShiftMask);
  803. X          else if (be->button & Button2)
  804. X!             (*canvas_middlebut_proc)(x, y, be->state&ShiftMask);
  805. X          break;
  806. X      case KeyPress:
  807. X!         /* if arrow keys are pressed, pan */
  808. X!         t=XLookupKeysym(ke,0);
  809. X!                 if (t==XK_Left||
  810. X!                     t==XK_Right ||
  811. X!                     t==XK_Up ||
  812. X!                     t==XK_Down)
  813. X!         { switch(t)
  814. X!           { case XK_Left:  zoomxoff-=ZOOMSTEP;
  815. X!                    if (zoomxoff<0) zoomxoff=0;
  816. X!                    break;
  817. X!             case XK_Up:  zoomyoff-=ZOOMSTEP;
  818. X!                  if (zoomyoff<0) zoomyoff=0;
  819. X!                  break;
  820. X!             case XK_Right: zoomxoff+=ZOOMSTEP;
  821. X!                                  break;
  822. X!             case XK_Down: zoomyoff+=ZOOMSTEP;
  823. X!                   break;
  824. X!                   }
  825. X!           setup_rulers();
  826. X!           redisplay_rulers();
  827. X!           setup_grid(0);
  828. X!                }
  829. X!                else
  830. X!                { if (XLookupString(ke, buf, sizeof(buf),NULL,NULL) > 0)
  831. X!            (*canvas_kbd_proc)((unsigned char)buf[0]);
  832. X!                }
  833. X!            break;
  834. X      }
  835. X  }
  836. X  
  837. X*** @xfig.pl9/change.c    Tue Oct 16 08:33:15 1990
  838. X--- ./change.c    Fri Jun 14 14:20:14 1991
  839. X***************
  840. X*** 26,32 ****
  841. X  #include "font.h"
  842. X  #include "psfonts.h"
  843. X  
  844. X- #define TOLERANCE 7
  845. X  #define min(a, b)    (((a) < (b)) ? (a) : (b))
  846. X  #define max(a, b)    (((a) > (b)) ? (a) : (b))
  847. X  
  848. X--- 26,31 ----
  849. X***************
  850. X*** 42,55 ****
  851. X  extern    null_proc();
  852. X  extern    set_popupmenu();
  853. X  
  854. X- extern    F_text        *text_search();
  855. X  
  856. X  extern    int        foreground_color, background_color;
  857. X  extern    Pixmap        font_menu_bitmaps[];
  858. X! extern    int    *font_sel;        /* pointer to store font selected from popup */
  859. X! extern    Widget    image_widget;        /* which widget to store image of font in */
  860. X  extern    Window    canvas_win;
  861. X  
  862. X  extern    change_text();
  863. X  extern    change_item();
  864. X  extern    change_depth_up();
  865. X--- 41,57 ----
  866. X  extern    null_proc();
  867. X  extern    set_popupmenu();
  868. X  
  869. X  
  870. X  extern    int        foreground_color, background_color;
  871. X  extern    Pixmap        font_menu_bitmaps[];
  872. X! 
  873. X! extern    int    *font_sel;    /* pointer to store font selected from popup */
  874. X! extern    Widget    image_widget;    /* which widget to store image of font in */
  875. X  extern    Window    canvas_win;
  876. X  
  877. X+ extern int init_object_search();
  878. X+ extern int object_search();
  879. X+ 
  880. X  extern    change_text();
  881. X  extern    change_item();
  882. X  extern    change_depth_up();
  883. X***************
  884. X*** 66,83 ****
  885. X  static        get_f_pos();
  886. X  static        points_panel();
  887. X  static        get_points();
  888. X! static    XtCallbackProc toggle(), done_button(), apply_button(), cancel_button();
  889. X  static    void    line_style_select();
  890. X  static    void    text_adjust_select();
  891. X  static    Widget    popup, form;
  892. X  static    Widget    below, beside;
  893. X  
  894. X! extern    F_line        *line_search(),        *copy_line();
  895. X! extern    F_arc        *arc_search(),        *copy_arc();
  896. X! extern    F_ellipse    *ellipse_search(),    *copy_ellipse();
  897. X! extern    F_text        *text_search(),        *copy_text();
  898. X! extern    F_spline    *spline_search(),    *copy_spline();
  899. X! extern    F_compound    *compound_search();
  900. X  extern    F_arrow        *forward_arrow(),    *backward_arrow();
  901. X  extern    F_compound    objects;
  902. X  
  903. X--- 68,85 ----
  904. X  static        get_f_pos();
  905. X  static        points_panel();
  906. X  static        get_points();
  907. X! static    XtCallbackProc toggle_fill(), done_button(), 
  908. X!             apply_button(), cancel_button();
  909. X  static    void    line_style_select();
  910. X  static    void    text_adjust_select();
  911. X  static    Widget    popup, form;
  912. X  static    Widget    below, beside;
  913. X  
  914. X! extern    F_line        *copy_line();
  915. X! extern    F_arc        *copy_arc();
  916. X! extern    F_ellipse    *copy_ellipse();
  917. X! extern    F_text        *copy_text();
  918. X! extern    F_spline    *copy_spline();
  919. X  extern    F_arrow        *forward_arrow(),    *backward_arrow();
  920. X  extern    F_compound    objects;
  921. X  
  922. X***************
  923. X*** 91,96 ****
  924. X--- 93,99 ----
  925. X  extern    int        RHS_PANL;
  926. X  extern    float        cur_dashlength;
  927. X  extern    float        cur_dotgap;
  928. X+ extern  int        line_thickness;
  929. X  
  930. X  /*    not use        init_change();*/
  931. X  static    int        done_compound();
  932. X***************
  933. X*** 114,119 ****
  934. X--- 117,123 ----
  935. X  static    Widget    angle_panel;
  936. X  static    Widget    adjust_panel;
  937. X  static    Widget    area_fill_panel;
  938. X+ static    Widget    dash_label;
  939. X  static    Widget    fill_pct_label;
  940. X  static    Widget    style_panel;
  941. X  static    Widget    style_val_panel;
  942. X***************
  943. X*** 208,214 ****
  944. X  {
  945. X      canvas_kbd_proc = null_proc;
  946. X      canvas_locmove_proc = null_proc;
  947. X!     canvas_leftbut_proc = change_item;
  948. X      canvas_middlebut_proc = null_proc;
  949. X      canvas_rightbut_proc = set_popupmenu;
  950. X      return_proc = change_item_selected;
  951. X--- 212,220 ----
  952. X  {
  953. X      canvas_kbd_proc = null_proc;
  954. X      canvas_locmove_proc = null_proc;
  955. X!     /* store handler address with object_search */
  956. X!     init_object_search(change_item);
  957. X!     canvas_leftbut_proc = object_search;
  958. X      canvas_middlebut_proc = null_proc;
  959. X      canvas_rightbut_proc = set_popupmenu;
  960. X      return_proc = change_item_selected;
  961. X***************
  962. X*** 217,231 ****
  963. X  }
  964. X  
  965. X  
  966. X! change_item(x, y)
  967. X  int     x, y;
  968. X  {
  969. X-     extern F_line        *line_search();
  970. X-     extern F_arc        *arc_search();
  971. X-     extern F_ellipse    *ellipse_search();
  972. X-     extern F_text        *text_search();
  973. X-     extern F_spline        *spline_search();
  974. X-     extern F_compound    *compound_search();
  975. X      F_line            *l;
  976. X      F_arc            *a;
  977. X      F_ellipse        *e;
  978. X--- 223,233 ----
  979. X  }
  980. X  
  981. X  
  982. X! change_item(p,type,x, y)
  983. X! char *p;
  984. X! int type;
  985. X  int     x, y;
  986. X  {
  987. X      F_line            *l;
  988. X      F_arc            *a;
  989. X      F_ellipse        *e;
  990. X***************
  991. X*** 232,259 ****
  992. X      F_text            *t;
  993. X      F_spline        *s;
  994. X      F_compound        *c;
  995. X-     int            dummy;
  996. X  
  997. X  
  998. X!         if ((l = line_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
  999. X!         make_window_line(l);
  1000. X      }
  1001. X-         else if ((t = text_search(x, y)) != NULL) {
  1002. X-         make_window_text(t);
  1003. X-     }
  1004. X-         else if ((e = ellipse_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
  1005. X-         make_window_ellipse(e);
  1006. X-     }
  1007. X-         else if ((a = arc_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
  1008. X-         make_window_arc(a);
  1009. X-     }
  1010. X-         else if ((s = spline_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
  1011. X-         make_window_spline(s);
  1012. X-     }
  1013. X-     else     if ((c = compound_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL)
  1014. X-         make_window_compound(c);
  1015. X-     else
  1016. X-         return;
  1017. X  
  1018. X      XtPopup(popup, XtGrabExclusive);
  1019. X  }
  1020. X--- 234,256 ----
  1021. X      F_text            *t;
  1022. X      F_spline        *s;
  1023. X      F_compound        *c;
  1024. X  
  1025. X  
  1026. X!     switch(type)
  1027. X!     { case O_POLYLINE: make_window_line((F_line *) p);
  1028. X!                break;
  1029. X!       case O_TEXT: make_window_text((F_text *) p);
  1030. X!                break;
  1031. X!       case O_ELLIPSE: make_window_ellipse((F_ellipse *) p);
  1032. X!                break;
  1033. X!       case O_ARC: make_window_arc((F_arc *) p);
  1034. X!                break;
  1035. X!       case O_SPLINE: make_window_spline((F_spline *) p);
  1036. X!                break;
  1037. X!       case O_COMPOUND: make_window_compound((F_compound *) p);
  1038. X!                break;
  1039. X!       default: return;
  1040. X      }
  1041. X  
  1042. X      XtPopup(popup, XtGrabExclusive);
  1043. X  }
  1044. X***************
  1045. X*** 474,480 ****
  1046. X  {
  1047. X      F_text    *old_text;
  1048. X  
  1049. X!     draw_text(new_text, INV_PAINT);
  1050. X      old_text = new_text->next;
  1051. X      switch (button_result) {
  1052. X          case APPLY:
  1053. X--- 471,477 ----
  1054. X  {
  1055. X      F_text    *old_text;
  1056. X  
  1057. X!     draw_text(new_text, ERASE);
  1058. X      old_text = new_text->next;
  1059. X      switch (button_result) {
  1060. X          case APPLY:
  1061. X***************
  1062. X*** 836,842 ****
  1063. X      insert_text(&objects.texts, tnew);
  1064. X      set_latesttext(told);
  1065. X      told->next = tnew;
  1066. X!     draw_text(told, INV_PAINT);
  1067. X      draw_text(tnew, PAINT);
  1068. X      }
  1069. X  
  1070. X--- 833,839 ----
  1071. X      insert_text(&objects.texts, tnew);
  1072. X      set_latesttext(told);
  1073. X      told->next = tnew;
  1074. X!     draw_text(told, ERASE);
  1075. X      draw_text(tnew, PAINT);
  1076. X      }
  1077. X  
  1078. X***************
  1079. X*** 851,856 ****
  1080. X--- 848,855 ----
  1081. X      generic_vals.thickness = atoi(panel_get_value(thickness_panel));
  1082. X      generic_vals.color =     atoi(panel_get_value(color_panel));
  1083. X      generic_vals.depth =     atoi(panel_get_value(depth_panel));
  1084. X+     /* include dash length in panel, too */
  1085. X+     generic_vals.style_val = (float) atof(panel_get_value(style_val_panel));
  1086. X      if (!no_fill_flag)
  1087. X      {
  1088. X      val = panel_get_value(area_fill_panel);
  1089. X***************
  1090. X*** 956,961 ****
  1091. X--- 955,962 ----
  1092. X      int        i, fill, dist;
  1093. X      Widget        image;
  1094. X      Pixmap        image_pm;
  1095. X+     Pixel        fg,bg;
  1096. X+     Arg        arg[2];
  1097. X  
  1098. X      static char * menu_item_names[] = {
  1099. X          "Solid Line ", "Dashed Line", "Dotted Line"};
  1100. X***************
  1101. X*** 993,1014 ****
  1102. X              break;
  1103. X              }
  1104. X          }
  1105. X      /* doesn't already exist, create a pixmap from the data (ala panel.c) */
  1106. X      if (!image_pm)
  1107. X          {
  1108. X          image_pm = XCreateBitmapFromData(tool_d, canvas_win,
  1109. X              icon->data, icon->width, icon->height);
  1110. X          pix_table[i].image_pm = image_pm;
  1111. X          pix_table[i].image = icon;
  1112. X          }
  1113. X!     n=0;
  1114. X!     XtSetArg(args[n], XtNbitmap, image_pm); n++;
  1115. X!     XtSetArg(args[n], XtNfromHoriz, label); n++;
  1116. X!     XtSetArg(args[n], XtNtop,    XtChainTop); n++;
  1117. X!     XtSetArg(args[n], XtNbottom, XtChainTop); n++;
  1118. X!     XtSetArg(args[n], XtNleft,   XtChainRight); n++;
  1119. X!     XtSetArg(args[n], XtNright,  XtChainRight); n++;
  1120. X!     image = XtCreateManagedWidget("image", labelWidgetClass, form, args, n);
  1121. X  
  1122. X      /* get height of label widget and distance between widgets */
  1123. X      n = 0;
  1124. X--- 994,1029 ----
  1125. X              break;
  1126. X              }
  1127. X          }
  1128. X+     n=0;
  1129. X+     XtSetArg(args[n], XtNfromHoriz, label); n++;
  1130. X+     XtSetArg(args[n], XtNtop,    XtChainTop); n++;
  1131. X+     XtSetArg(args[n], XtNbottom, XtChainTop); n++;
  1132. X+     XtSetArg(args[n], XtNleft,   XtChainRight); n++;
  1133. X+     XtSetArg(args[n], XtNright,  XtChainRight); n++;
  1134. X+     image = XtCreateManagedWidget("image", labelWidgetClass, form, args, n);
  1135. X+ 
  1136. X      /* doesn't already exist, create a pixmap from the data (ala panel.c) */
  1137. X      if (!image_pm)
  1138. X          {
  1139. X+ /* OpenWindows bug doesn't handle the one-plane bitmap on a multi-plane display */
  1140. X+ #ifdef OPENWIN
  1141. X+         XtSetArg(args[0], XtNforeground, &fg);    /* get the foreground/background of the widget */
  1142. X+         XtSetArg(args[1], XtNbackground, &bg);
  1143. X+         XtGetValues(image, args, TWO);
  1144. X+ 
  1145. X+         image_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  1146. X+             icon->data, icon->width, icon->height, 
  1147. X+             fg, bg, XDefaultDepthOfScreen(tool_s));
  1148. X+ #else
  1149. X          image_pm = XCreateBitmapFromData(tool_d, canvas_win,
  1150. X              icon->data, icon->width, icon->height);
  1151. X+ #endif
  1152. X          pix_table[i].image_pm = image_pm;
  1153. X          pix_table[i].image = icon;
  1154. X          }
  1155. X!     /* now put in the bitmap */
  1156. X!     XtSetArg(args[0], XtNbitmap, image_pm);
  1157. X!     XtSetValues(image,args,ONE);
  1158. X  
  1159. X      /* get height of label widget and distance between widgets */
  1160. X      n = 0;
  1161. X***************
  1162. X*** 1050,1057 ****
  1163. X          int_panel(generic_vals.color, "Color:", &color_panel);
  1164. X          int_panel(generic_vals.depth, "Depth:", &depth_panel);
  1165. X  
  1166. X!         if (generic_vals.area_fill == 0 ||
  1167. X!             strcmp(sub_type,"Polyline") == 0) /* no area fill for polyline */
  1168. X          {
  1169. X          fill = 100;
  1170. X          no_fill_flag = TRUE;
  1171. X--- 1065,1073 ----
  1172. X          int_panel(generic_vals.color, "Color:", &color_panel);
  1173. X          int_panel(generic_vals.depth, "Depth:", &depth_panel);
  1174. X  
  1175. X!         /*if (generic_vals.area_fill == 0 ||
  1176. X!             strcmp(sub_type,"Polyline") == 0)*/ /* no area fill for polyline */
  1177. X!         if (generic_vals.area_fill == 0)
  1178. X          {
  1179. X          fill = 100;
  1180. X          no_fill_flag = TRUE;
  1181. X***************
  1182. X*** 1062,1083 ****
  1183. X          no_fill_flag = FALSE;
  1184. X          }
  1185. X  
  1186. X!         if (strcmp(sub_type,"Polyline") != 0) /* no area fill for polyline */
  1187. X!         {
  1188. X!         toggle_panel(no_fill_flag, no_fill_flag? "Not Filled": "Filled    ",
  1189. X!                 &filled_panel);
  1190. X!         int_panel(fill,"Fill%:", &area_fill_panel);
  1191. X!         fill_pct_label = beside;    /* save pointer to Fill% label */
  1192. X!         XtSetArg(args[0], XtNsensitive, no_fill_flag? False: True);
  1193. X!         XtSetArg(args[1], XtNvertDistance, 2);
  1194. X!         XtSetValues(area_fill_panel, args, TWO);
  1195. X!         XtSetValues(fill_pct_label, args, TWO);
  1196. X!         if (no_fill_flag)
  1197. X!             sprintf(buf," ");
  1198. X!         else
  1199. X!             sprintf(buf,"%d",fill);
  1200. X!         panel_set_value(area_fill_panel,buf);
  1201. X!         }
  1202. X  
  1203. X          /* make popup line style menu */
  1204. X  
  1205. X--- 1078,1092 ----
  1206. X          no_fill_flag = FALSE;
  1207. X          }
  1208. X  
  1209. X!         toggle_panel(no_fill_flag, no_fill_flag? "Not Filled": "Filled    ",
  1210. X!             &filled_panel);
  1211. X!         int_panel(fill,"Fill%:", &area_fill_panel);
  1212. X!         fill_pct_label = beside;    /* save pointer to Fill% label */
  1213. X!         XtSetArg(args[0], XtNsensitive, no_fill_flag? False: True);
  1214. X!         XtSetArg(args[1], XtNvertDistance, 2);
  1215. X!         XtSetValues(area_fill_panel, args, TWO);
  1216. X!         XtSetValues(fill_pct_label, args, TWO);
  1217. X!         panel_clear_value(area_fill_panel);
  1218. X  
  1219. X          /* make popup line style menu */
  1220. X  
  1221. X***************
  1222. X*** 1088,1093 ****
  1223. X--- 1097,1114 ----
  1224. X          below = style_panel;
  1225. X          menu = make_popup_menu(menu_item_names, XtNumber(menu_item_names),
  1226. X                  style_panel, line_style_select);
  1227. X+         /* new field for style_val */
  1228. X+         float_panel(generic_vals.style_val, "Dash Length/Dot Gap:", &style_val_panel);
  1229. X+         /* save pointer to dash/dot gap label panel */
  1230. X+         dash_label = beside;    
  1231. X+         if (generic_vals.style == SOLID_LINE)
  1232. X+         {
  1233. X+         XtSetArg(args[0], XtNsensitive, False);
  1234. X+         XtSetValues(style_val_panel, args, ONE);
  1235. X+         XtSetValues(dash_label, args, ONE);
  1236. X+         /* and clear any value from the dash length panel */
  1237. X+         panel_clear_value(style_val_panel);
  1238. X+         }
  1239. X  #ifdef notdef
  1240. X  
  1241. X      }
  1242. X***************
  1243. X*** 1207,1212 ****
  1244. X--- 1228,1255 ----
  1245. X      below = *pi_x;
  1246. X      }
  1247. X  
  1248. X+ static
  1249. X+ float_panel(x, label,  pi_x)
  1250. X+ float        x;
  1251. X+ char        *label;
  1252. X+ Widget        *pi_x;
  1253. X+ {
  1254. X+     char buf[32];
  1255. X+ 
  1256. X+     XtSetArg(args[0], XtNfromVert, below);
  1257. X+     XtSetArg(args[1], XtNlabel, label);
  1258. X+     beside = XtCreateManagedWidget(label, labelWidgetClass, form, args, TWO);
  1259. X+     
  1260. X+     sprintf(buf, "%1.1f", x);
  1261. X+     XtSetArg(args[1], XtNstring, buf);
  1262. X+         XtSetArg(args[2], XtNinsertPosition, strlen(buf));
  1263. X+     XtSetArg(args[3], XtNfromHoriz, beside);
  1264. X+     XtSetArg(args[4], XtNeditType, "append");
  1265. X+     XtSetArg(args[5], XtNwidth, 40);
  1266. X+     *pi_x = XtCreateManagedWidget(label, asciiTextWidgetClass, form, args, SIX);
  1267. X+     below = *pi_x;
  1268. X+     }
  1269. X+ 
  1270. X  /* don't allow newlines in text until we handle multiple line texts */
  1271. X  
  1272. X  static String text_translations =
  1273. X***************
  1274. X*** 1250,1255 ****
  1275. X--- 1293,1300 ----
  1276. X      if (nlines > 6)        /* limit to displaying 6 lines and show scrollbars */
  1277. X          nlines=6;
  1278. X      n=0;
  1279. X+     if (nlines == 1)    /* if only one line, allow space for scrollbar */
  1280. X+         nlines=2;
  1281. X      XtSetArg(args[n], XtNfromVert, below);        n++;
  1282. X      XtSetArg(args[n], XtNstring,  string);        n++;
  1283. X      XtSetArg(args[n], XtNinsertPosition, strlen(string));    n++;
  1284. X***************
  1285. X*** 1277,1283 ****
  1286. X      XtSetArg(args[1], XtNlabel, label);
  1287. X      XtSetArg(args[2], XtNvalue, x);
  1288. X      *pi_x = XtCreateManagedWidget(label, toggleWidgetClass, form, args, THREE);
  1289. X!     XtAddCallback(*pi_x, XtNcallback, toggle, NULL);
  1290. X      below = *pi_x;
  1291. X      }
  1292. X  
  1293. X--- 1322,1328 ----
  1294. X      XtSetArg(args[1], XtNlabel, label);
  1295. X      XtSetArg(args[2], XtNvalue, x);
  1296. X      *pi_x = XtCreateManagedWidget(label, toggleWidgetClass, form, args, THREE);
  1297. X!     XtAddCallback(*pi_x, XtNcallback, toggle_fill, NULL);
  1298. X      below = *pi_x;
  1299. X      }
  1300. X  
  1301. X***************
  1302. X*** 1480,1485 ****
  1303. X--- 1525,1531 ----
  1304. X  Widget w;
  1305. X  XtPointer style, garbage;
  1306. X  {
  1307. X+     char buf[10]; /* buffer for style_val text */
  1308. X  
  1309. X      XtSetArg(args[0], XtNlabel, XtName(w));
  1310. X      XtSetValues(style_panel, args, ONE);
  1311. X***************
  1312. X*** 1489,1503 ****
  1313. X      switch(generic_vals.style)
  1314. X      {
  1315. X      case SOLID_LINE:
  1316. X!         generic_vals.style_val = 0.0;
  1317. X          break;
  1318. X      case DASH_LINE:
  1319. X!         generic_vals.style_val = cur_dashlength;
  1320. X          break;
  1321. X      case DOTTED_LINE:
  1322. X!         generic_vals.style_val = cur_dotgap;
  1323. X              break;
  1324. X      }
  1325. X  }
  1326. X  
  1327. X  static void
  1328. X--- 1535,1565 ----
  1329. X      switch(generic_vals.style)
  1330. X      {
  1331. X      case SOLID_LINE:
  1332. X!         /*generic_vals.style_val = 0.0;*/
  1333. X!         XtSetArg(args[0], XtNsensitive, False);
  1334. X!         /* clear out any dash length number from panel */
  1335. X!         sprintf(buf," ");
  1336. X          break;
  1337. X      case DASH_LINE:
  1338. X!         /* if style_val contains no useful value, set it to the
  1339. X!            default dashlength, scaled by the line thickness */
  1340. X!         if (generic_vals.style_val<0.1)
  1341. X!         generic_vals.style_val = cur_dashlength*(line_thickness+1)/2;
  1342. X!         sprintf(buf,"%1.1f",generic_vals.style_val);
  1343. X!         XtSetArg(args[0], XtNsensitive, True);
  1344. X          break;
  1345. X      case DOTTED_LINE:
  1346. X!         if (generic_vals.style_val<0.1)
  1347. X!         generic_vals.style_val = cur_dotgap*(line_thickness+1)/2;
  1348. X!         sprintf(buf,"%1.1f",generic_vals.style_val);
  1349. X!         XtSetArg(args[0], XtNsensitive, True);
  1350. X              break;
  1351. X      }
  1352. X+     /* make both the label and value panels sensitive or insensitive */
  1353. X+     XtSetValues(style_val_panel, args, ONE);
  1354. X+     XtSetValues(dash_label, args, ONE);
  1355. X+     /* put the value in the value panel */
  1356. X+     panel_set_value(style_val_panel,buf);
  1357. X  }
  1358. X  
  1359. X  static void
  1360. X***************
  1361. X*** 1511,1526 ****
  1362. X      text_adjust = (int) adjust;
  1363. X  }
  1364. X  
  1365. X- 
  1366. X  static XtCallbackProc
  1367. X! toggle(w, clos, garbage)
  1368. X  Widget w;
  1369. X  XtPointer clos, garbage;
  1370. X! {
  1371. X      char buf[5];
  1372. X      int fill;
  1373. X  
  1374. X!     if(no_fill_flag == TRUE)
  1375. X          no_fill_flag = FALSE;
  1376. X      else
  1377. X          no_fill_flag = TRUE;
  1378. X--- 1573,1587 ----
  1379. X      text_adjust = (int) adjust;
  1380. X  }
  1381. X  
  1382. X  static XtCallbackProc
  1383. X! toggle_fill(w, clos, garbage)
  1384. X  Widget w;
  1385. X  XtPointer clos, garbage;
  1386. X!     {
  1387. X      char buf[5];
  1388. X      int fill;
  1389. X  
  1390. X!     if (no_fill_flag == TRUE)
  1391. X          no_fill_flag = FALSE;
  1392. X      else
  1393. X          no_fill_flag = TRUE;
  1394. X***************
  1395. X*** 1536,1544 ****
  1396. X      fill = (NUMFILLPATS - generic_vals.area_fill) * (100/(NUMFILLPATS-1));
  1397. X      if (fill > 100)
  1398. X          fill = 100;
  1399. X      if (no_fill_flag)
  1400. X          sprintf(buf," ");
  1401. X      else
  1402. X          sprintf(buf,"%d",fill);
  1403. X      panel_set_value(area_fill_panel,buf);
  1404. X! }
  1405. X--- 1597,1614 ----
  1406. X      fill = (NUMFILLPATS - generic_vals.area_fill) * (100/(NUMFILLPATS-1));
  1407. X      if (fill > 100)
  1408. X          fill = 100;
  1409. X+     /* if fill is off, blank out fill % value */
  1410. X      if (no_fill_flag)
  1411. X          sprintf(buf," ");
  1412. X      else
  1413. X          sprintf(buf,"%d",fill);
  1414. X      panel_set_value(area_fill_panel,buf);
  1415. X!     }
  1416. X! 
  1417. X! panel_clear_value(w)
  1418. X! Widget w;
  1419. X!     {
  1420. X!     char buf[2];
  1421. X!     sprintf(buf," ");
  1422. X!     panel_set_value(w,buf);
  1423. X!     }
  1424. X*** @xfig.pl9/char.c    Wed Aug  1 15:41:24 1990
  1425. X--- ./char.c    Wed Jun 12 11:15:43 1991
  1426. X***************
  1427. X*** 11,16 ****
  1428. X--- 11,17 ----
  1429. X  #include "font.h"
  1430. X  #include "paintop.h"
  1431. X  #include "object.h"
  1432. X+ #include "zoom.h"
  1433. X  
  1434. X  extern int        cur_x, cur_y;
  1435. X  extern int        cur_font, cur_fontsize;
  1436. X***************
  1437. X*** 37,43 ****
  1438. X  draw_cursor(x, y)
  1439. X  int    x, y;
  1440. X  {
  1441. X!     pw_vector(pw, x, y, x, y-char_ht, INV_PAINT, 1, SOLID_LINE, 0.0);
  1442. X      }
  1443. X  
  1444. X  initialize_char_handler(p, cr, bx, by)
  1445. X--- 38,44 ----
  1446. X  draw_cursor(x, y)
  1447. X  int    x, y;
  1448. X  {
  1449. X!     pw_vector(pw, x, y, x, y-char_ht, INV_PAINT, 1, RUBBER_LINE, 0.0);
  1450. X      }
  1451. X  
  1452. X  initialize_char_handler(p, cr, bx, by)
  1453. X***************
  1454. X*** 59,84 ****
  1455. X  
  1456. X  terminate_char_handler()
  1457. X  {
  1458. X      turn_off_blinking_cursor();
  1459. X      cr_proc = NULL;
  1460. X!     return(char_received);
  1461. X      }
  1462. X  
  1463. X  erase_char_string()
  1464. X  {
  1465. X!     pw_text(pw, cbase_x, cbase_y, INV_PAINT, 
  1466. X          cur_font, cur_fontsize, prefix);
  1467. X      if (leng_suffix) 
  1468. X!         pw_text(pw, cur_x, cbase_y, INV_PAINT, 
  1469. X              cur_font, cur_fontsize, suffix);
  1470. X      }
  1471. X  
  1472. X  draw_char_string()
  1473. X  {
  1474. X!     pw_text(pw, cbase_x, cbase_y, INV_PAINT, 
  1475. X          cur_font, cur_fontsize, prefix);
  1476. X      if (leng_suffix) 
  1477. X!         pw_text(pw, cur_x, cbase_y, INV_PAINT, 
  1478. X              cur_font, cur_fontsize, suffix);
  1479. X      move_blinking_cursor(cur_x, cur_y);
  1480. X      }
  1481. X--- 60,90 ----
  1482. X  
  1483. X  terminate_char_handler()
  1484. X  {
  1485. X+     int save_char_rec;
  1486. X+ 
  1487. X      turn_off_blinking_cursor();
  1488. X+     erase_char_string();
  1489. X      cr_proc = NULL;
  1490. X!     save_char_rec = char_received;
  1491. X!     char_received = 0;
  1492. X!     return(save_char_rec);
  1493. X      }
  1494. X  
  1495. X  erase_char_string()
  1496. X  {
  1497. X!     pw_text(pw, cbase_x, cbase_y, ERASE, 
  1498. X          cur_font, cur_fontsize, prefix);
  1499. X      if (leng_suffix) 
  1500. X!         pw_text(pw, cur_x, cbase_y, ERASE, 
  1501. X              cur_font, cur_fontsize, suffix);
  1502. X      }
  1503. X  
  1504. X  draw_char_string()
  1505. X  {
  1506. X!     pw_text(pw, cbase_x, cbase_y, PAINT, 
  1507. X          cur_font, cur_fontsize, prefix);
  1508. X      if (leng_suffix) 
  1509. X!         pw_text(pw, cur_x, cbase_y, PAINT, 
  1510. X              cur_font, cur_fontsize, suffix);
  1511. X      move_blinking_cursor(cur_x, cur_y);
  1512. X      }
  1513. X***************
  1514. X*** 145,159 ****
  1515. X      else {
  1516. X          erase_char_string();
  1517. X          cwidth = char_advance(canvas_font,c);
  1518. X          if (cur_textjust == T_LEFT_JUSTIFIED)
  1519. X!             rcur_x += cwidth;    /* move the suffix to the right */
  1520. X          else if (cur_textjust == T_CENTER_JUSTIFIED)
  1521. X!         {
  1522. X!         rbase_x -= cwidth/2.0;        /* advance left by half cwidth */
  1523. X!         rcur_x += cwidth/2.0;        /* move suffix right half cwidth */
  1524. X          }
  1525. X          if (cur_textjust == T_RIGHT_JUSTIFIED)
  1526. X!             rbase_x -= cwidth;    /* move the prefix to the left */
  1527. X          char_received = 1;
  1528. X          prefix[leng_prefix++] = c;
  1529. X          prefix[leng_prefix] = '\0';
  1530. X--- 151,170 ----
  1531. X      else {
  1532. X          erase_char_string();
  1533. X         cwidth = char_advance(canvas_font,c);
  1534. X+         /* note: text dimensions must be corrected for the 
  1535. X+            zoom factor! */
  1536. X          if (cur_textjust == T_LEFT_JUSTIFIED)
  1537. X!         /* move the suffix to the right */
  1538. X!             rcur_x += cwidth/zoomscale;    
  1539. X          else if (cur_textjust == T_CENTER_JUSTIFIED)
  1540. X!         { /* advance left by half cwidth */
  1541. X!         rbase_x -= cwidth/2.0/zoomscale;        
  1542. X!           /* move suffix right half cwidth */
  1543. X!         rcur_x += cwidth/2.0/zoomscale;        
  1544. X          }
  1545. X          if (cur_textjust == T_RIGHT_JUSTIFIED)
  1546. X!         /* move the prefix to the left */
  1547. X!         rbase_x -= cwidth/zoomscale;    
  1548. X          char_received = 1;
  1549. X          prefix[leng_prefix++] = c;
  1550. X          prefix[leng_prefix] = '\0';
  1551. X*** @xfig.pl9/const.h    Wed Aug  1 15:19:00 1990
  1552. X--- ./const.h    Mon Jun  3 11:16:27 1991
  1553. X***************
  1554. X*** 14,20 ****
  1555. X  #define        DEF_CANVAS_WIDTH_P    8*PIX_PER_INCH
  1556. X  
  1557. X  /* Landscape dimensions */
  1558. X! #define        DEF_CANVAS_HEIGHT_L    8*PIX_PER_INCH
  1559. X  #define        DEF_CANVAS_WIDTH_L    10*PIX_PER_INCH
  1560. X  
  1561. X  #define        RULER_WIDTH        20
  1562. X--- 14,20 ----
  1563. X  #define        DEF_CANVAS_WIDTH_P    8*PIX_PER_INCH
  1564. X  
  1565. X  /* Landscape dimensions */
  1566. X! #define        DEF_CANVAS_HEIGHT_L    8.5*PIX_PER_INCH
  1567. X  #define        DEF_CANVAS_WIDTH_L    10*PIX_PER_INCH
  1568. X  
  1569. X  #define        RULER_WIDTH        20
  1570. X*** @xfig.pl9/copy.c    Fri Sep 21 09:38:39 1990
  1571. X--- ./copy.c    Mon Jun  3 13:25:16 1991
  1572. X***************
  1573. X*** 35,41 ****
  1574. X  extern F_compound    objects;
  1575. X  
  1576. X  extern char        cut_buf_name[];
  1577. X- extern char        *sys_errlist[];
  1578. X  extern int        pointmarker_shown;
  1579. X  
  1580. X  extern int        copy_selected();
  1581. X--- 35,40 ----
  1582. X***************
  1583. X*** 42,47 ****
  1584. X--- 41,49 ----
  1585. X  extern int        init_copy();
  1586. X  extern int        init_file_cut();
  1587. X  
  1588. X+ extern int init_object_search();
  1589. X+ extern int object_search();
  1590. X+ 
  1591. X  static    (*save_kbd_proc)();
  1592. X  static    (*save_locmove_proc)();
  1593. X  static    (*save_leftbut_proc)();
  1594. X***************
  1595. X*** 55,61 ****
  1596. X  {
  1597. X      canvas_kbd_proc = null_proc;
  1598. X      canvas_locmove_proc = null_proc;
  1599. X!     canvas_leftbut_proc = init_copy;
  1600. X      canvas_middlebut_proc = null_proc;
  1601. X      canvas_rightbut_proc = set_popupmenu;
  1602. X      return_proc = copy_selected;
  1603. X--- 57,65 ----
  1604. X  {
  1605. X      canvas_kbd_proc = null_proc;
  1606. X      canvas_locmove_proc = null_proc;
  1607. X!     /* store handler address with object_search */
  1608. X!     init_object_search(init_copy);
  1609. X!     canvas_leftbut_proc = object_search;
  1610. X      canvas_middlebut_proc = null_proc;
  1611. X      canvas_rightbut_proc = set_popupmenu;
  1612. X      return_proc = copy_selected;
  1613. X***************
  1614. X*** 63,70 ****
  1615. X      reset_action_on();
  1616. X      }
  1617. X  
  1618. X! init_copy(x, y)
  1619. X  int    x, y;
  1620. X  {
  1621. X      F_line        *l, *line;
  1622. X      F_ellipse    *e, *ellipse;
  1623. X--- 67,77 ----
  1624. X      reset_action_on();
  1625. X      }
  1626. X  
  1627. X! init_copy(p,type,x, y,px,py)
  1628. X! char *p;
  1629. X! int type;
  1630. X  int    x, y;
  1631. X+ int px,py;
  1632. X  {
  1633. X      F_line        *l, *line;
  1634. X      F_ellipse    *e, *ellipse;
  1635. X***************
  1636. X*** 72,80 ****
  1637. X      F_spline    *s, *spline;
  1638. X      F_arc        *a, *arc;
  1639. X      F_compound    *c, *compound;
  1640. X-     int        px, py;
  1641. X  
  1642. X!     if ((c = compound_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1643. X          compound = copy_compound(c);
  1644. X          erase_pointmarker();
  1645. X          set_temp_cursor(&null_cursor);
  1646. X--- 79,88 ----
  1647. X      F_spline    *s, *spline;
  1648. X      F_arc        *a, *arc;
  1649. X      F_compound    *c, *compound;
  1650. X  
  1651. X!     switch(type)
  1652. X!     { case O_COMPOUND:
  1653. X!         c=(F_compound *) p;
  1654. X          compound = copy_compound(c);
  1655. X          erase_pointmarker();
  1656. X          set_temp_cursor(&null_cursor);
  1657. X***************
  1658. X*** 84,91 ****
  1659. X          insert_compound(&objects.compounds, compound);
  1660. X          set_latestcompound(compound);
  1661. X          init_compounddragging(compound, px, py);
  1662. X!         }
  1663. X!     else if ((l = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1664. X          line = copy_line(l);
  1665. X          erase_pointmarker();
  1666. X          set_temp_cursor(&null_cursor);
  1667. X--- 92,100 ----
  1668. X          insert_compound(&objects.compounds, compound);
  1669. X          set_latestcompound(compound);
  1670. X          init_compounddragging(compound, px, py);
  1671. X!         break;
  1672. X!       case O_POLYLINE:
  1673. X!         l=(F_line *) p;
  1674. X          line = copy_line(l);
  1675. X          erase_pointmarker();
  1676. X          set_temp_cursor(&null_cursor);
  1677. X***************
  1678. X*** 95,102 ****
  1679. X          insert_line(&objects.lines, line);
  1680. X          set_latestline(line);
  1681. X          init_linedragging(line, px, py);
  1682. X!         }
  1683. X!     else if ((t = text_search(x, y)) != NULL) {
  1684. X          text = copy_text(t);
  1685. X          erase_pointmarker();
  1686. X          set_temp_cursor(&null_cursor);
  1687. X--- 104,112 ----
  1688. X          insert_line(&objects.lines, line);
  1689. X          set_latestline(line);
  1690. X          init_linedragging(line, px, py);
  1691. X!         break;
  1692. X!       case O_TEXT:
  1693. X!         t=(F_text *) p;
  1694. X          text = copy_text(t);
  1695. X          erase_pointmarker();
  1696. X          set_temp_cursor(&null_cursor);
  1697. X***************
  1698. X*** 105,112 ****
  1699. X          insert_text(&objects.texts, text);
  1700. X          set_latesttext(text);
  1701. X          init_textdragging(text, x, y);
  1702. X!         }
  1703. X!     else if ((e = ellipse_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1704. X          ellipse = copy_ellipse(e);
  1705. X          erase_pointmarker();
  1706. X          set_temp_cursor(&null_cursor);
  1707. X--- 115,123 ----
  1708. X          insert_text(&objects.texts, text);
  1709. X          set_latesttext(text);
  1710. X          init_textdragging(text, x, y);
  1711. X!         break;
  1712. X!       case O_ELLIPSE:
  1713. X!         e=(F_ellipse *) p;
  1714. X          ellipse = copy_ellipse(e);
  1715. X          erase_pointmarker();
  1716. X          set_temp_cursor(&null_cursor);
  1717. X***************
  1718. X*** 116,123 ****
  1719. X          insert_ellipse(&objects.ellipses, ellipse);
  1720. X          set_latestellipse(ellipse);
  1721. X          init_ellipsedragging(ellipse, px, py);
  1722. X!         }
  1723. X!     else if ((a = arc_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1724. X          arc = copy_arc(a);
  1725. X          erase_pointmarker();
  1726. X          set_temp_cursor(&null_cursor);
  1727. X--- 127,135 ----
  1728. X          insert_ellipse(&objects.ellipses, ellipse);
  1729. X          set_latestellipse(ellipse);
  1730. X          init_ellipsedragging(ellipse, px, py);
  1731. X!         break;
  1732. X!       case O_ARC:
  1733. X!         a=(F_arc *) p;
  1734. X          arc = copy_arc(a);
  1735. X          erase_pointmarker();
  1736. X          set_temp_cursor(&null_cursor);
  1737. X***************
  1738. X*** 127,134 ****
  1739. X          insert_arc(&objects.arcs, arc);
  1740. X          set_latestarc(arc);
  1741. X          init_arcdragging(arc, px, py);
  1742. X!         }
  1743. X!     else if ((s = spline_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1744. X          spline = copy_spline(s);
  1745. X          erase_pointmarker();
  1746. X          set_temp_cursor(&null_cursor);
  1747. X--- 139,147 ----
  1748. X          insert_arc(&objects.arcs, arc);
  1749. X          set_latestarc(arc);
  1750. X          init_arcdragging(arc, px, py);
  1751. X!         break;
  1752. X!       case O_SPLINE:
  1753. X!         s=(F_spline *) p;
  1754. X          spline = copy_spline(s);
  1755. X          erase_pointmarker();
  1756. X          set_temp_cursor(&null_cursor);
  1757. X***************
  1758. X*** 138,148 ****
  1759. X          insert_spline(&objects.splines, spline);
  1760. X          set_latestspline(spline);
  1761. X          init_splinedragging(spline, px, py);
  1762. X!         }
  1763. X!     else
  1764. X          return;
  1765. X-     canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1766. X      }
  1767. X  
  1768. X  file_cut_selected()
  1769. X  {
  1770. X--- 151,162 ----
  1771. X          insert_spline(&objects.splines, spline);
  1772. X          set_latestspline(spline);
  1773. X          init_splinedragging(spline, px, py);
  1774. X!         break;
  1775. X!       default:
  1776. X          return;
  1777. X      }
  1778. X+     canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1779. X+       }
  1780. X  
  1781. X  file_cut_selected()
  1782. X  {
  1783. END_OF_FILE
  1784. if test 51690 -ne `wc -c <'patch10.1'`; then
  1785.     echo shar: \"'patch10.1'\" unpacked with wrong size!
  1786. fi
  1787. # end of 'patch10.1'
  1788. fi
  1789. echo shar: End of archive 3 \(of 4\).
  1790. cp /dev/null ark3isdone
  1791. MISSING=""
  1792. for I in 1 2 3 4 ; do
  1793.     if test ! -f ark${I}isdone ; then
  1794.     MISSING="${MISSING} ${I}"
  1795.     fi
  1796. done
  1797. if test "${MISSING}" = "" ; then
  1798.     echo You have unpacked all 4 archives.
  1799.     rm -f ark[1-9]isdone
  1800. else
  1801.     echo You still need to unpack the following archives:
  1802.     echo "        " ${MISSING}
  1803. fi
  1804. ##  End of shell archive.
  1805. exit 0
  1806.  
  1807. --
  1808. Dan Heller
  1809. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  1810. Senior Writer                President          comp-sources-x@uunet.uu.net
  1811. argv@ora.com                 argv@zipcode.com
  1812.